class EnferiPawn extends xPawn;

var() int MyPatrolPath;

event PostBeginPlay()
{
 local PathNodeInfo pni;
 local EnferiPathNode epn;
 local float minDist, curDist;
 local int bestPath;

 super.PostBeginPlay();

 GiveWeapon("Enyara.Scourge");
 GiveWeapon("Enyara.Tazer");

  minDist = 0;
  foreach AllActors(class'PathNodeInfo', pni) {
    foreach AllActors(class'EnferiPathNode', epn) {
      curDist = VSize(epn.Location - Location);
      //log(""$curdist);
      if (curDist < minDist || minDist == 0) {
        minDist = curDist;
        bestPath = epn.myPatrolPath;
      }
    }
    //log("My best Path is "$bestpath);
    MyPatrolPath = bestPath;

    pni.CurrentPathsTaken++;
    //log("PatrolPath: "$MyPatrolPath);
  }

 SetPhysics(PHYS_Walking);
}

defaultproperties
{
     ControllerClass=Class'Enyara.EnferiController'
     SightRadius=20.00
     RequiredEquipment(0)=""
     RequiredEquipment(1)=""
     mesh=SkeletalMesh'HumanMaleA.NightMaleB'
     skins(0)=Texture'PlayerSkins.NightMaleBBodyA'
     skins(1)=Texture'PlayerSkins.NightMaleBHeadB'
}
